package cms.jason.entity;

import com.cn.lotary.base.dao.AbstractEntity;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Jason
 */
@Entity
@Table(name = "article_site", catalog = "cms", schema = "")
@XmlRootElement
public class ArticleSite extends AbstractEntity {

    private static final long serialVersionUID = 1L;
    @Size(max = 45)
    @Column(length = 45)
    private String name;
    @Size(max = 45)
    @Column(length = 45)
    private String remark;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "articleSite")
    private List<Article> articleList;

    public ArticleSite() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @XmlTransient
    public List<Article> getArticleList() {
        return articleList;
    }

    public void setArticleList(List<Article> articleList) {
        this.articleList = articleList;
    }

    @Override
    public String toString() {
        return "ArticleSite{" + "name=" + name + ", remark=" + remark + '}';
    }
}
